import request from '@/utils/request';
import { ApiResponse, ApiRequest } from '@/interface/api/public';
/**
 * 公共请求接口
 * @param query 参数
 * @returns
 */
export function fetchPublic(query: ApiRequest) {
  return request<ApiResponse>({
    url: query.url,
    method: query.method,
    data: query.data,
    loading: query.loading ?? false,
  });
}
/**
 * 上传文件
 * @param data 参数
 * @returns
 */
export function fetchUpload(data) {
  return request<ApiResponse>({
    url: '/solrj/demo/upload',
    method: 'post',
    data,
  });
}

/**
 * 上传文件
 * @param data 参数
 * @returns
 */
export function fetchQuery(data) {
  return request<ApiResponse>({
    url: '/solrj/demo/query',
    method: 'get',
    data,
  });
}

export function fetchTest(data) {
  return request<ApiResponse>({
    url: '/login/normal',
    method: 'post',
    data,
  });
}
